package day_240428.q2;

public class Person {
    // state
    // 根据注解（按住 Ctrl 鼠标点击 getField 方法），在 state
    // 前面加上 public 就可以被访问到了
    String name;
    int age;

    // constructor
    public Person() {
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    // behavior
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
